export default {
    data() {
        return {
            pagination: {
                page: 1,
                limit: 10,
                total: 0,
            }
        }
    },
    methods: {
        getPagination(param = {}) {
            if (param && param.page) this.pagination.page = param.page
            if (param && param.limit) this.pagination.page = param.limit
            if (param && param.total) this.pagination.page = param.total
            const baseParams = {
                page: this.pagination.page,
                limit: this.pagination.size,
            }
            return baseParams
        },
        setPage(page) {
            this.pagination.page = page
            return this
        },
        setLimit(limit) {
            this.pagination.limit = limit
            return this
        },
        setTotal(total) {
            this.pagination.total = total
            return this
        }
    }
}